﻿using Furion;
using Furion.DatabaseAccessor;
using Furion.DynamicApiController;
using HiSportApplet.Application.Service.Text.Service;
using HiSportApplet.Core.Service.Cache;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HiSportApplet.Application.Service.Text
{

    [ApiDescriptionSettings("测试", Tag = "测试", SplitCamelCase = false)]
    public class TextAppService : IDynamicApiController
    {
        private readonly ITestService _tsetApp;



        public TextAppService()
        {
            _tsetApp = App.GetService<ITestService>();
        }

        /// <summary>
        /// CodeFirst
        /// </summary>
        /// <returns></returns>
       
        public async Task<bool> CodeFirst()
        {
            return await _tsetApp.CodeFirst();
        }

        [UnitOfWork]
        [AllowAnonymous]
        public async Task<bool> Text1()
        {

            App.GetRequiredService<SysCacheService>().Set("22222", "33333");
            return await _tsetApp.Text1();
        }

        public async Task<bool> Text2()
        {
            return await _tsetApp.Text2();
        }
    }
}
